From: Robert Marko Date: Wed, 16 Apr 2025 12:04:26 +0000 (+0200) Subject: tools: gmp: fix compilation with GCC15 X-Git-Tag: v23.05.6~34 X-Git-Url: http://git.openwrt.org/%22https:/collectd.org/%22http:/www.crowdsec.net//%22https%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22https%22?a=commitdiff_plain;h=75d2f9f1c8a70ef950124a710ab0578b8569199c;p=openwrt%2Fopenwrt.git tools: gmp: fix compilation with GCC15 Fedora 42 updated to GCC15 which now defaults to GNU23 as the default instead of GNU17[1], and this breaks GMP compilation by failing to find a working compiler test. Its been fixed upstream [2][3], so backport the fix to fix GCC15 compilation. [1] https://gcc.gnu.org/gcc-15/porting_to.html#c23 [2] https://gmplib.org/repo/gmp/rev/8e7bb4ae7a18 [3] https://gmplib.org/repo/gmp/rev/d66d66d82dbb Link: https://github.com/openwrt/openwrt/pull/18506 (cherry picked from commit 31800db91d43042813b7249a09fd61c356b39767) Link: https://github.com/openwrt/openwrt/pull/18581 Signed-off-by: Robert Marko (cherry picked from commit d9fccc8e1a246bfa10a62ffaf60328d7f65178ed) Link: https://github.com/openwrt/openwrt/pull/19065 Signed-off-by: Hauke Mehrtens --- diff --git a/tools/gmp/patches/001-acinclude-m4-fix-std23.patch b/tools/gmp/patches/001-acinclude-m4-fix-std23.patch new file mode 100644 index 0000000000..05271764b7 --- /dev/null +++ b/tools/gmp/patches/001-acinclude-m4-fix-std23.patch @@ -0,0 +1,19 @@ +# HG changeset patch +# User Marc Glisse +# Date 1738186682 -3600 +# Wed Jan 29 22:38:02 2025 +0100 +# Node ID 8e7bb4ae7a18b1405ea7f9cbcda450b7d920a901 +# Parent e84c5c785bbe8ed8c3620194e50b65adfc2f5d83 +Complete function prototype in acinclude.m4 for C23 compatibility + +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long + + #if defined (__GNUC__) && ! defined (__cplusplus) + typedef unsigned long long t1;typedef t1*t2; +-void g(){} ++void g(int,t1 const*,t1,t2,t1 const*,int){} + void h(){} + static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) + {t1 c,x,r;int i;if(v0){c=1;for(i=1;i +# Date 1743513946 -7200 +# Tue Apr 01 15:25:46 2025 +0200 +# Node ID d66d66d82dbbe4f561920d28c1e1cbe6818452c7 +# Parent 1a2ad0e32507e842486c8ac9d5cdc772fd0c335e +Add parameter names to function prototype + + 2025-02-01 Marc Glisse + + * longlong.h (loongarch64 umul_ppmm): __int128__ -> __int128. +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long + + #if defined (__GNUC__) && ! defined (__cplusplus) + typedef unsigned long long t1;typedef t1*t2; +-void g(int,t1 const*,t1,t2,t1 const*,int){} ++void g(int a,t1 const*b,t1 c,t2 d,t1 const*e,int f){} + void h(){} + static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) + {t1 c,x,r;int i;if(v0){c=1;for(i=1;i